GAPExamination <- function (TS, onlyGaps=TRUE) {
  GAP <- CSPGap(TS)
  LAGTS <- lag(TS, 1)
  ATRTS <- ATR(cbind(Hi(TS),Lo(TS),Cl(TS)))
  WIN <- cbind(Lo(TS) - Hi(LAGTS), Lo(LAGTS) - Hi(TS))
  colnames(WIN) <- c("UpWin", "DnWin")
  
  # average of OHLC prices
  AV <- OHLC_Average(TS)
  LAGAV <- Lag(AV)
  
  # shift in average OHLC price
  AvPts <- (GAP[,"GapUp"] | GAP[,"GapDown"]) * abs( (AV[,1] - LAGAV[,1]) )
  colnames(AvPts) <- c("AvPts")
  
  # shift in average OHLC price / previous bar's ATR
  AvATRRatio <- (GAP[,"GapUp"] | GAP[,"GapDown"]) * abs( (AV[,1] - LAGAV[,1])/lag(ATRTS[,"atr"]) )
  colnames(AvATRRatio) <- c("AARatio")
  
  # color of candle after GAP
  CColor <- (GAP[,"GapUp"] | GAP[,"GapDown"]) * ((Cl(TS) > Op(TS)) + (Cl(TS) < Op(TS))*(-1))
  colnames(CColor) <- c("CColor")
  
  # return XTS object
  EXAM <- cbind(TS, GAP, ATRTS[,"atr"], AV, AvPts, AvATRRatio, CColor)
  
  if (onlyGaps==TRUE) {
    return (EXAM[ EXAM[,"atr"]>0 & (EXAM[,"GapUp"]>0 | EXAM[,"GapDown"]>0) ])
  } else {
    return (EXAM)    
  }
}